import { createApp } from 'vue'
import App from './App.vue'
import Container from './components/container/Container.vue'
import router from './router'
import './assets/font/iconfont.css'
import './assets/font/font.css'
import 'nprogress/nprogress.css'
// axios
import http from './api/index.js'
// element
import { ElMessage, ElNotification } from 'element-plus'
import installElementPlus from './plugins/element'
import store from './store'
// import APlayer from '@moefe/vue-aplayer'
import VueSocketIO from 'vue-3-socket.io'
import io from 'socket.io-client'


const app = createApp(App)

app.component("Container", Container)
app.config.globalProperties.$elmsg = ElMessage
app.config.globalProperties.$notify = ElNotification
app.config.globalProperties.$http = http()
installElementPlus(app)


app
  .use(store)
  .use(router)
  .use(new VueSocketIO({
    debug: true,
    connection: io.connect('http://127.0.0.1:3000',{
      autoConnect: false, // 关闭自动连接
    }),
    vuex: {
      store,
      actionPrefix: 'SOCKET_',
      mutationPrefix: 'SOCKET_'
    },
  }))
  .mount('#app')








